<!-- 迭代阶段表单弹窗 -->
<form id="stage-sys-form" lay-filter="stage-sys-form" class="layui-form model-form">
    <input name="sicode" id="sicode" type="hidden"/>
    <div class="layui-form-item">
        <label class="layui-form-label">迭代内容</label>
        <div class="layui-input-block">
            <input name="conten" placeholder="请输入迭代内容" type="text" class="layui-input"
                   lay-verify="required" required autocomplete="off"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input name="iorder" type="text" class="layui-input"
                   lay-verify="required" required autocomplete="off"/>
        </div>
    </div>
    <div class="layui-form-item model-form-footer">
        <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button>
        <button class="layui-btn" lay-filter="stage-sys-form-submit" lay-submit>保存</button>
    </div>
</form>

<script>
    layui.use(['layer', 'admin', 'form'], function () {
        var layer = layui.layer;
        var admin = layui.admin;
        var form = layui.form;

        $('#sicode').val(admin.getTempData('t_stage_iter'));

        // 表单提交事件
        form.on('submit(stage-sys-form-submit)', function (data) {
            admin.req('api-study/stageIter/insert', JSON.stringify(data.field), function (data) {
                layer.closeAll('loading');
                if (data.code === 0) {
                    layer.msg(data.msg, {icon: 1, time: 500});
                    admin.finishPopupCenter();
                } else {
                    layer.msg(data.msg, {icon: 2, time: 500});
                }
            }, 'POST');

            return false;
        });
    });
</script>